public void printEdge2(Node head){
    //打印边界节点，不包含单独一列不是最外面的
    if(head==null)return;
    
    System.out.print(head.value+" ");
    if(head.left!=null&&head.right!=null){
        printLeft(head,print);
        printRight(head,print);
    }else{
        printEdge2(head.left!=null?head.left:head.right);            
        }
    }

    public void printLeft(Node h, boolean print){
        if(h==null)return;

        if(print||(h.right==null&&h.left==null)){
            System.out.print(h.value+" ");
        }
        printLeft(h.left,print);
        printLeft(h.right,print&&h.left==null?true:false);
    }

    public void printRight(Node h, boolean print){
        if(h==null)return;
        printRight(h.right,print);
        printRight(h.left,print&&h.right==null?true:false);
        if(print||(h.right==null&h.left==null)){
            System.out.print(h.value+" ");
        }
    }

}


